package com.wave12.pro_cart.controller;

import com.wave12.pro_cart.entity.*;
import com.wave12.pro_cart.service.*;
import com.wave12.utility.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping(value = "/cart")
public class CartController {
    private static final Logger logger = LoggerFactory.getLogger(CartController.class);
    @Autowired
    private CartService cartService;
    
    /**
     * 获取一个补单的详情
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping(value="/getOneProCartDetail", method = RequestMethod.POST)
    public Result getOneProCartDetail(HttpServletRequest request){
        //Cart cartDetail = cartService.getOneProCartDetail();
        Cart c = new Cart();
        c.setId(1L);
        c.setOwnerId("2");
        System.out.println(c);
        return Result.succeed(0, "", c);
    }
    

    @ResponseBody
    @RequestMapping(value="/makeOneCart", method = RequestMethod.POST)
    public Result makeOneCart(HttpServletRequest request, @RequestBody Cart cart){

        return Result.succeed(0, "", "");
    }

}
